package com.bstek.ureport.parser.impl.searchform;

import org.apache.commons.lang.StringUtils;
import org.dom4j.Element;

import com.bstek.ureport.definition.searchform.LabelPosition;
import com.bstek.ureport.definition.searchform.Option;
import com.bstek.ureport.definition.searchform.CombotreeComponent;

public class CombotreeParser implements FormParser<CombotreeComponent>{
    @Override
    public CombotreeComponent parse(Element element) {
        CombotreeComponent tree=new CombotreeComponent();
        tree.setBindParameter(element.attributeValue("bind-parameter"));
        tree.setLabel(element.attributeValue("label"));
        tree.setType(element.attributeValue("type"));
        tree.setLabelPosition(LabelPosition.valueOf(element.attributeValue("label-position")));
        tree.setDataType(element.attributeValue("dataType"));
        return tree;
    }
    @Override
    public boolean support(String name) {
        return name.equals("Combotree");
    }
}
